package edu.zjut.hjg.saas.web.controller.home;

import static edu.zjut.hjg.saas.web.support.SaaSConstants.SESSION_NAME_TENANT;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import edu.zjut.hjg.saas.common.annotation.CookieSessionOut;

/**
 * 退出登录控制器
 * 
 * @author hjg
 */
@Controller
@RequestMapping("/logout.htm")
public class LogoutController {

    @RequestMapping
    @CookieSessionOut(SESSION_NAME_TENANT)
    public String logout(Model model) {
        model.addAttribute(SESSION_NAME_TENANT, null);
        return "redirect:/index.htm";
    }
}
